home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 43
/
043.d81
/
video poker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
139 lines
10 ifx=0thenx=1:load"video poker.ml",8,1
20 poke53280,4:gosub1190:cl=54272:vl=cl+24:dimz$(15):fora=cltovl:pokea,0:next
30 n$="":g$=" ":pokevl,8
40 fora=1to15:readb,c,d,z$(a):e=int((40-len(z$(a)))/2):f=40-len(z$(a))-e-2
50 iff<0thenf=0
60 ifa=5thenz$(a)=z$(a)+chr$(58)
70 z$(a)=left$(g$,e)+z$(a)+left$(g$,f):printchr$(c);:poke198,.
80 forg=1to38:printleft$(n$,b)""right$(z$(a),g)
85 if(peek(198)>.)and(a>2)thena=15:g=38
90 tn=32:t1=17:ifa=2ora=4ora=15thentn=16:t1=33
100 pokecl,128:pokecl+1,d:pokecl+4,tn:ifleft$(right$(z$(a),g),1)=" "then130
110 ifleft$(right$(z$(2),g),1)="c"then130
120 pokecl+5,136:pokecl+6,136:pokecl+4,t1
130 next:ifa=2thengosub1070
140 z$(a)=mid$(z$(a),4,28):z$(a)=""+z$(a):next:pokecl+4,0:fora=1to100:next
150 gosub1190:poke198,0:printleft$(n$,5)tab(6)"how many players (1 to 4)?
160 [161]s$:[139]s$[178]""[167]160
170 nm[178][197](s$):[139]nm[179]1[176]nm[177]4[167]150
180 [141]1190:[129]a[178]1[164]nm:[153]"name of player"a"= ";:[133]nm$(a)
185 [139]nm$(a)[178]""[167]180
190 [129]rj[178]1[164][195](nm$(a)):[139][201](nm$(a),1)[177][199](64)[175][201](nm$(a),1)[179][199](91)[167]210
200 nm$(a)[178][200](nm$(a),[195](nm$(a))[171]1)
210 [130]rj:[139][195](nm$(a))[177]16[167]nm$(nm)[178][200](nm$(nm),16)
220 [130]:[134]j%(13,4):b$[178][200](n$,20):jw$[178][200](n$,10):x[178][187]([171]ti)
230 [129]a[178]1[164]nm:sc$(a)[178]" $0":[130]
240 [141]1150:wx[178]101
250 dk$[178]" ":d$[178]b$[170]dk$:e$[178][200](n$,15)
260 hd[178]hd[170]1:[129]tr[178]1[164]nm:[141]1010:[141]1190
270 [153][200](n$,5)[166]13)"hit kwait to keep"
280 [153][200](n$,7)[166]12)"hit cwait to change":[141]1090:dc[178]10
285 [153]" clrpress q to quit":[129]k[178]1[164]5
290 x[178][181]([187](1)[172]13)[170]1:y[178][181]([187](1)[172]4)[170]1:[139]j%(x,y)[178]1[167]290
300 j%(x,y)[178]1:b4[178]32:cr[178]144:[151]781,x:[151]782,y
310 [158]49333:c4[178][194](782):a4[178][194](781):[139]x[178]10[167]b4[178]48
320 [139]y[178]3[176]y[178]1[167]cr[178]28
330 [139]x[178]1[167]x[178]14
340 [139]k[177]5[167][142]
350 pt(k)[178]x:st(k)[178]y:[153][200](n$,dc)[163]8[172]k[171]7);:[141]830:[139]h$[178]"y"[167][142]
360 [130]:[151]198,0:[153]d$:[153]b$[163]13)"keep or change?":[129]dk[178]1[164]5:[141]950:[139]ct[179]rr[167][130]
370 dc[178]10:[129]ua[178]1[164]5
380 [139]a(ua)[177]0[167]k[178]ua:a4[178]a(ua):b4[178]b(ua):c4[178]c(ua):d4[178]32:cr[178]cr(ua):[141]830
390 [130]:[153]d$e$dk$:[129]a[178]1[164]5:a(a)[178]0:b(a)[178]0:c(a)[178]0:[151](1015[170]a),pt(a):[130]
400 [158]49242:[129]a[178]1[164]5:pt(a)[178][194](1015[170]a):[130]
410 [139]pt(5)[171]pt(4)[178]1[167][139]pt(4)[171]pt(3)[178]1[167][139]pt(3)[171]pt(2)[178]1[167][139]pt(2)[171]pt(1)[178]1[167]ss[178]1
420 [139]st(1)[178]st(2)[167][139]st(2)[178]st(3)[167][139]st(3)[178]st(4)[167][139]st(4)[178]st(5)[167]fl[178]1
430 [158]49294:xe[178][194](1011):zq[178][194](1012):z$[178]" you lost!!"
440 [139]pt(1)[178]pt(2)[167][139]pt(1)[178]pt(3)[167][139]pt(1)[178]pt(4)[167]fr[178]1
450 [139]pt(5)[178]pt(4)[167][139]pt(5)[178]pt(3)[167][139]pt(5)[178]pt(2)[167]fr[178]1
460 [139]ss[178]1[167][139]fl[178]1[167][139]pt(5)[178]14[167]mn[178]249:z$[178]z$(6):[137]560
470 [139]ss[178]1[167][139]fl[178]1[167]mn[178]99:z$[178]z$(7):[137]560
480 [139]fr[178]1[167]mn[178]19:z$[178]z$(8):[137]560
490 [139]zq[178]4[167][139]fr[179][177]1[167]mn[178]9:z$[178]z$(9):[137]560
500 [139]fl[178]1[167]mn[178]7:z$[178]z$(10):[137]560
510 [139]ss[178]1[167]mn[178]4:z$[178]z$(11):[137]560
520 [139]zq[178]3[167]mn[178]3:z$[178]z$(12):[137]560
530 [139]zq[178]2[167]mn[178]2:z$[178]z$(13):[137]560
540 [139]zq[178]1[167][139]xe[177][178]11[167]z$[178]z$(14):mn[178]0
550 [139][202](z$,20,1)[178]"l"[167]qp[178]1:mn[178][171]1
560 sc(tr)[178]sc(tr)[170]mn
570 ds[178]16:[141]1090:[153]"clr":[139]qp[178]1[167][153]"stop":ds[178]32
580 [129]a[178]1[164]5:[153]b$z$:ww[178]20:[129]b[178]135[164]243[169]12:[139]qp[178]1[167][129]b[178]243[164]135[169][171]12:ww[178]32
590 [151]cl[170]4,ds[170]1:[151]cl[170]1,b:[151]cl,b:[129]c[178]1[164]ww:[130]:[130]:[151]cl[170]4,ds:[153]d$:[129]d[178]1[164]100:[130]:[130]
600 [129]x[178]1[164]13:[129]y[178]1[164]4:j%(x,y)[178]0:[130]:[130]:k[178]0
610 [129]a[178]1[164]5:pt(a)[178]0:st(a)[178]0:[130]:ss[178]0:fl[178]0:zq[178]0:fr[178]0:xe[178]0:qp[178]0:ct[178]0:ua[178]0
620 [129]a[178]1[164]1500:[130]:h$[178]"":[139]mn[179]2[167]820
630 [141]1190:[151]53280,2:[153]""[163]12)"hi-lo bonus round
640 ifh$="y"thenreturn
650 gosub1090:print"do you want to play bonus (y[146]/n[146])?
660 [161]h$:[139]h$[178]""[167]660
670 [139]h$[178]"n"[167]820
680 [139]h$[179][177]"y"[167]630
690 dc[178]10:[141]630:[141]1090:k[178]2:[141]290:k[178]4:[141]290
700 [139][182](pt(2)[171]pt(4))[178]1[176]pt(2)[171]pt(4)[178]0[167]qp[178]1:z$[178]" you lose $1!"
710 [139]qp[178]1[167]bt[178]1:[137]800
720 [153][200](n$,17)[163]13)"payoff is 2:1
730 mn$=str$(mn)
740 printleft$(n$,19)tab(6)"enter bet between $1 and $"right$(mn$,len(mn$)-1);
750 inputja$:bt=int(val(ja$))
760 print"[145][145][145][145][145]":fora=1to6:printdk$:next:ifbt<1orbt>mnthen740
770 dc=13:k=3:gosub290:z$=" you lose!!":qp=1
780 if(pt(3)<pt(4)andpt(3)>pt(2))or(pt(3)>pt(4)andpt(3)<pt(2))thenqp=0
790 ifqp=0thenz$=" you win!!!":sc(tr)=sc(tr)+2*bt
800 h$="":ifqp=1thensc(tr)=sc(tr)-bt
810 mn=0:goto570
820 nexttr:goto260
830 wz=wx
840 wx=int(rnd(1)*128)+25:ifabs(wz-wx)<30then840
850 wb=wx-64:ifwb<20thenwb=20
860 x1=a4:x2=b4:x3=c4:x4=cr:a4=166:b4=166:c4=166:d4=166:cr=28:ifua>0then880
870 gosub920
880 fora=1to3:pokevl,12:pokecl+1,wb:pokecl,wx:pokecl+4,17:printleft$(n$,dc+1)tab(8*k-6);
890 gosub930:forb=1to100:next:pokecl+4,16:wb=wb+3:ifa=1thencr=30
900 ifa=2thencr=31
910 next:a4=x1:b4=x2:c4=x3:d4=32:cr=x4:printleft$(n$,dc+1)tab(8*k-6);:gosub930:return
920 print"[144][176][192][192][192][192][174][157][157][157][157][157][157][221] [221][157][157][157][157][157][157][221] [221][157][157][157][157][157][157][221] [221][157][157][157][157][157][157][173][192][192][192][192][189]":return
930 printchr$(cr)chr$(a4)chr$(b4)chr$(d4)chr$(d4)"[157][157][157][157]"chr$(d4)chr$(c4)chr$(c4)chr$(d4);
940 print"[157][157][157][157]"chr$(d4)chr$(d4)chr$(a4)chr$(b4):return
950 printe$spc(dk*8-4)"?":fora=1to100:next:printe$spc(dk*8-4)" ":fora=1to50:next
960 geth$:ifh$=""then950
965 ifh$="q"thengosub60000
970 ifh$="k"thenreturn
980 ifasc(h$)<>67then950
990 ct=ct+1:gosub290:pt(dk)=x:st(dk)=y:b(dk)=b4:c(dk)=c4:a(dk)=a4:cr(dk)=cr
1000 cr=30:a4=166:b4=166:c4=166:d4=166:printleft$(n$,11)tab(8*dk-6);:gosub930:return
1010 poke53280,8:gosub1190:print""tab(16)"[144]hand"hd:md=((34-len(nm$(tr)))/2)
1020 printleft$(n$,6)tab(md)""nm$(tr)" is up"::printtab(15)"winnings:
1030 [129]d[178]1[164]nm:md[178][195](nm$(d)):e[178][195]([196](sc(d)))
1040 [153]""[163](35[171]md[171]e)[173]2)nm$(d)" ="sc$(d):[130]
1050 [129]a[178]1[164]4:[129]b[178]0[164]15:[151]53280,b:[129]c[178]1[164]50:[130]:[130]
1060 [130]:[151]53280,14:[142]
1070 [158]49364:[129]h[178]1[164]3:[129]i[178]0[164]15:[151]53280,i:[129]j[178]1[164]50:[130]:[130]:[130]
1080 [151]53280,4:[142]
1090 md[178][195](nm$(tr)):[153][200](n$,3)[163](25[171]md)[173]2)""nm$(tr)"'s";
1100 sc$(tr)[178][196](sc(tr))
1110 sm$[178]" ":[139][200](sc$(tr),1)[178]"-"[167]sm$[178]" -"
1120 sc$(tr)[178][201](sc$(tr),[195](sc$(tr))[171]1)
1130 sc$(tr)[178]sm$[170]"$"[170]sc$(tr)[170]"wait "
1140 [153]" winnings:"sc$(tr):[142]
1150 [141]1190:[153]" max. # of draw cards (1 to 5)?
1160 getrr$:ifrr$=""then1160
1170 rr=val(rr$):ifrr<1orrr>5then1150
1180 return
1190 print"[147]":poke53281,1:sys49152:return
1200 data2,144,35,*** video poker ***,3,28,26
1210 datacopyright 1984-1987 by a. j. kwitowski
1220 data5,30,32,up to 4 can play ,7,154,35,"hi-lo bonus option on wins over $1 "
1230 data10,28,32,you win as follows,12,31,30,royal flush = $250
1240 data13,31,28,straight flush = $100,14,31,26,4 of a kind = $20
1250 data15,31,24,full house = $10,16,31,22,flush = $8
1260 data17,31,20,"straight = $5 ",18,31,18,"3 of a kind = $4 "
1270 data19,31,16,2 pair = $3,20